<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="public::head('人员分配')">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="UTF-8"></meta>

</head>
<body style="padding-top:50px;">
<input type="hidden" th:value="${session.Id}" id="id"/>
<input type="hidden" th:value="${session.Type}" id="Type"/>

<div th:replace="public/top::top"></div>

<div id="Renyuanfenpeilist">
    <div th:replace="main/Upload"></div>

    <div class="primary-title">
        委员分配
    </div>
    <div class="primary-content">
        <div style="margin-top:15px;text-align: center;">
            <label  style="margin-left: 20px;">姓名：</label><input type="text" class="form-control" style="width: 150px;display:inline-block;"  v-model="usernametext"  >
            <button class="btn btn-info" @click="bindRenyuanList()" style="margin-left:15px;">查询</button>
        </div>

        <table class="table table-hover table-striped">
            <thead>
            <th style="text-align:center;vertical-align:middle;">序号</th>
            <th style="text-align:center;vertical-align:middle;">姓名</th>
            <th style="text-align:center;vertical-align:middle;">部职别</th>
            <th style="text-align:center;vertical-align:middle;width:160px;" >操作</th>
            </thead>
            <tbody>
            <tr v-for="(renyuanitem,index) in renyuanlist" v-if="showrenyuan">
                <td style="text-align:center;vertical-align:middle;" v-text="index+1"></td>
                <td style="text-align:center;vertical-align:middle;" v-text="renyuanitem.username"></td>
                <td style="text-align:center;vertical-align:middle;" v-text="renyuanitem.buzhibie"></td>
                <td style="text-align:center;vertical-align:middle;" >
                    <button v-on:click="toAddfenpei(renyuanitem.userid)" class="btn btn-primary">加入表决</button>
                </td>
            </tr>

            </tbody>
        </table>
        <div v-if="!showrenyuan" style="text-align:center;width:100%;">暂无数据</div>


    </div>

    <div class="primary-content">
        <div style="margin-top:15px;text-align: center;font-size:24px">
            <label  style="margin-left: 20px; ">当前活动项目：{{xiangmu.xiangmuname}}</label>

        </div>
        <button style='float:right;margin-right:15px;width:120px;height:34px;color:#fff !important;' v-on:click="toshowUploadXlsAll()" class="btn btn-success">导入所有项目</button>
        <button style='float:right;margin-right:15px;width:120px;height:34px;color:#fff !important;' v-on:click="toshowUploadXls(xiangmuId)" class="btn btn-success">导入</button>

        <button class="btn btn-danger" @click="bindResetPWD()" style="float:right;margin-right:15px;">重置委员密码</button>
        <a target="_blank" class='btn btn-info'
           style='float:right;margin-right:15px;width:120px;height:34px;color:#fff !important;'
           :href="'/renyuanfenpei/exportRenyuan?xiangmuId='+xiangmuId">导出</a>

        <table class="table table-hover table-striped">
            <thead>
            <th style="text-align:center;vertical-align:middle;">序号</th>
            <th style="text-align:center;vertical-align:middle;">姓名</th>
            <th style="text-align:center;vertical-align:middle;">部职别</th>
            <th style="text-align:center;vertical-align:middle;">账号</th>
            <th style="text-align:center;vertical-align:middle;">密码</th>
            <th style="text-align:center;vertical-align:middle;width:160px;" >操作</th>
            </thead>
            <tbody>
            <tr v-for="(fenpeirenyuanitem,index) in fenpeirenyuanlist" v-if="showfenpeirenyuan">
                <td style="text-align:center;vertical-align:middle;" v-text="index+1"></td>
                <td style="text-align:center;vertical-align:middle;" v-text="fenpeirenyuanitem.username"></td>
                <td style="text-align:center;vertical-align:middle;" v-text="fenpeirenyuanitem.buzhibie"></td>
                <td style="text-align:center;vertical-align:middle;" v-text="fenpeirenyuanitem.account"></td>
                <td style="text-align:center;vertical-align:middle;" v-text="fenpeirenyuanitem.password"></td>
                <td style="text-align:center;vertical-align:middle;" >
                    <button v-on:click="toDelete(fenpeirenyuanitem.id)" class="btn btn-danger">删除</button>
                </td>
            </tr>

            </tbody>
        </table>
        <div v-if="!showfenpeirenyuan" style="text-align:center;width:100%;">暂无数据</div>



    </div>
</div>

</body>

<script th:src="@{/js/main/list_renyuanfenpei.js}"></script>

<script type="text/javascript">
    var ID = $("#id").val();
    $(function() {
        if(ID==""){
            alert("请先登录！");
            location.href='../main/login';
        }
    });
</script>

</html>